{__NOLAYOUT__}
<tagLib name="html" />
<style>
.form_hide{display:none;}
</style>
<html:select options="mutil_level_data_option_1" id="{$id_pre}mutil_level_data_{$type_id}_id_1" name="{$id_pre}mutil_level_data_{$type_id}_id_1" change="changeMultiLevelData{$id_pre}{$type_id}(1)" selected="mutil_level_data_id_1"/>
<html:select options="mutil_level_data_option_2" id="{$id_pre}mutil_level_data_{$type_id}_id_2" name="{$id_pre}mutil_level_data_{$type_id}_id_2" change="changeMultiLevelData{$id_pre}{$type_id}(2)" selected="mutil_level_data_id_2" style="form_hide"/>
<html:select options="mutil_level_data_option_3" id="{$id_pre}mutil_level_data_{$type_id}_id_3" name="{$id_pre}mutil_level_data_{$type_id}_id_3" change="changeMultiLevelData{$id_pre}{$type_id}(3)" selected="mutil_level_data_id_3" style="form_hide"/>

<script language="javascript">
	function changeMultiLevelData{$id_pre}{$type_id}(mutil_level_data_id)
	{
		var currnet_id = $("#{$id_pre}mutil_level_data_{$type_id}_id_"+mutil_level_data_id).val();
		if ('' == currnet_id) {
			if (1 == mutil_level_data_id) {
				$("#{$id_pre}mutil_level_data_{$type_id}_id_2").val('');
				$("#{$id_pre}mutil_level_data_{$type_id}_id_2").hide();
				$("#{$id_pre}mutil_level_data_{$type_id}_id_3").val('');
				$("#{$id_pre}mutil_level_data_{$type_id}_id_3").hide();
			}
			if (2 == mutil_level_data_id) {
				$("#{$id_pre}mutil_level_data_{$type_id}_id_3").val('');
				$("#{$id_pre}mutil_level_data_{$type_id}_id_3").hide();
			}
			return false;
		}
		sub_mutil_level_data_id = mutil_level_data_id+1;
		if(3 > mutil_level_data_id)
		{
			$.ajax({
				'type':'get',
				'url':'/Admin/Common/getAreaOptions',
				'data':{
						'id':currnet_id
					},
				async:false,
				success:function(data){
                    if (0 == data['count']) {
                        if (2 == mutil_level_data_id) {
                            $("#{$id_pre}mutil_level_data_{$type_id}_id_3").hide();
                            $("#{$id_pre}mutil_level_data_{$type_id}_id_3").html('');
                        }
                        return false;
                    }
                    select_data = '';
                    select_data = '<option></option>';
                    for(var i=0; i<data['count']; i++)
                    {
                        select_data += '<option value="'+data['data_list'][i]['key']+'">'+data['data_list'][i]['value']+'</option>';
                    }
                    $("#{$id_pre}mutil_level_data_{$type_id}_id_"+sub_mutil_level_data_id).html(select_data);
                    if(select_data)
                    {
                        $("#{$id_pre}mutil_level_data_{$type_id}_id_"+sub_mutil_level_data_id).show();
                    }
                    else
                    {
                        $("#{$id_pre}mutil_level_data_{$type_id}_id_"+sub_mutil_level_data_id).hide();
                        if(3 > mutil_level_data_id)
                        {
                            console.log(2);
                            $("#{$id_pre}mutil_level_data_{$type_id}_id_3").hide();
                            $("#{$id_pre}mutil_level_data_{$type_id}_id_3").html('');
                        }
                    }
                },
				'dataType':'json'
			});
			if(sub_mutil_level_data_id < 3)
			{
				changeMultiLevelData{$id_pre}{$type_id}(sub_mutil_level_data_id);
			}
		}
	}
	
	if(0 < '{$mutil_level_data_id_2}' || 0 < {$mutil_level_data_option_2_count})
	{
		$("#{$id_pre}mutil_level_data_{$type_id}_id_2").show();
	}
	
	if(0 < '{$mutil_level_data_id_3}' || 0 < {$mutil_level_data_option_3_count})
	{
		$("#{$id_pre}mutil_level_data_{$type_id}_id_3").show();
	}
</script>